// NDSFile.h: interface for the CNDSFile class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_NDSFILE_H__57E165A7_92F4_44CA_82A3_BF2184E7DB7E__INCLUDED_)
#define AFX_NDSFILE_H__57E165A7_92F4_44CA_82A3_BF2184E7DB7E__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "../Predefine.h"
#ifdef IPHONEOS
class IFileStream;
#endif
class CNDSFile  
{
public:
enum ESeekFlags
{
	SEEKMODE_SET				= 0,
	SEEKMODE_CUR				= 1,
	SEEKMODE_END				= 2
};

public:
#if 0
	IFileStream	*							m_pFile;
	IFileStream *							m_pWFile;
#else
	irr::io::IReadFile *					m_pFile;
	irr::io::IWriteFile *					m_pWFile;
#endif
	
public:
	unsigned short ReadUnsignedShort();
	unsigned char ReadUnsignedByte();
	unsigned int ConvertIntReverse(unsigned int nSrc);
	unsigned short ConvertReverse(unsigned short nSrc);
	unsigned short ReadUShortReverse();
	short ReadShortReverse();
	signed char ReadCharReverse();
	unsigned char ReadUCharReverse();
	unsigned int ReadIntReverse();

public:
	BOOL Seek(int mode,int offset);
	void Advance(int nByteCount);
	unsigned long GetFileSize();
	float ReadFloat();
	int ReadInt();
	int ReadLong();
	short ReadShort();
	signed char ReadChar();
	long Read(void * out_pData, long in_nSize);
	long Write(void * in_pData, long in_nSize);
	BOOL Open(const char* szFilePath);
	BOOL OpenSaveFile(const char *szFilePath, bool forWriting);
	void Close();
	CNDSFile();
	virtual ~CNDSFile();

};

#endif // !defined(AFX_NDSFILE_H__57E165A7_92F4_44CA_82A3_BF2184E7DB7E__INCLUDED_)
